cmake_minimum_required (VERSION 2.6)
add_library (fiberenv
    abs-time.cpp
    cooperative-condition.cpp
    cooperative-event.cpp
    cooperative-fd.cpp
    cooperative-file.cpp
    cooperative-mutex.cpp
    cooperative-rwlock.cpp
    cooperative-semaphore.cpp
    cooperative-socket.cpp
    cooperative-waitable.cpp
    epoll.cpp
    fiber-env.cpp
    fiber-env-impl.cpp
    fiber-impl.cpp
    interlocked.cpp
    log.cpp
    native-condition.cpp
    native-mutex.cpp
    native-rwlock.cpp
    platform-fiber.cpp
    thread.cpp
    wait-mgr.cpp
    waitable.cpp
    )
set (dist_files
    abs-time.h
    condition.h
    event.h
    fiber-env.h
    fiber.h
    file.h
    interlocked.h
    mutex.h
    queue.h
    rwlock.h
    semaphore.h
    socket.h
    waitable.h
    libfiberenv.a
    )
set (dist_dir ../../dist/fiber-env)
add_custom_command (TARGET fiberenv
    POST_BUILD
    COMMAND rm -rf ${dist_dir}/
    COMMAND mkdir -p ${dist_dir}/
    COMMAND cp ${dist_files} ${dist_dir}/
    )
